<?php


namespace platform\controllers;


use platform\models\LoginForm;

class PassportController extends BaseController
{
    public $modelClass = '';

    public function actions()
    {
        return [];
    }

    public function allowAction()
    {
        return ['login', 'logout'];
    }

    public function actionLogin()
    {
        $model = new LoginForm();
        $model->load(\Yii::$app->request->post(), '');
        $model->login();
        return $model;
    }

    public function actionLogout()
    {
        return \Yii::$app->user->logout();
    }
}